package com.heima.api;

import com.heima.model.schedule.dtos.Task;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @author DiXiaoNie
 * @since 2022/12/25 11:43
 */

@FeignClient("leadnews-schedule")
public interface ScheduleFeignClient {
    /**
     * 添加任务
     *
     * @param task 任务
     * @author DiXiaoNie
     * @date 2022/12/25
     */
    @PostMapping("/api/v1/schedule/addTask")
    public void addTask(@RequestBody Task task);

    /**
     * 把任务
     *
     * @param type     类型
     * @param priority 优先级
     * @return {@link Task }
     * @author DiXiaoNie
     * @date 2022/12/25
     */
    @GetMapping("/api/v1/schedule/pullTask/{type}/{priority}")
    public Task pullTask(@PathVariable("type") Integer type, @PathVariable("priority") Integer priority);
}
